#!/usr/bin/env sh

LINK=$(ps -aux | grep -v grep | grep -o "https.*")

if [ "$1" = "-y" ]
then
	printf "$LINK" | xclip -selection clipboard
else
	dunstify "MPV" "Download started!"
	youtube-dl -f 313+251/271+251/137+251/136+251/135+251/134+251/133+251/137+171/136+171/135+171/134+171/133+171/137+250/136+250/135+250/134+250/133+250/137+140/136+140/135+140/134+140/133+140 ${LINK} 1>/dev/null 2>&1
fi
